#ifndef _GPIO_BSP_H_
#define _GPIO_BSP_H_

#include "ioplatform.h"
#include "iortc.h"

struct gpio_devices_str
{
    unsigned int dev_flag;
};

struct system_static_data_str
{
    uint32_t flag;
    char bootnum;
    /* data */
};

extern struct system_static_data_str *system_static_data;

#define INIT_STAS 1
#define INIT_STORE 2

#define Clr_Bit(Port, Bit) Port &= ~(Bit)
#define Set_Bit(Port, Bit) Port |= (Bit)

struct system_par_str
{
    unsigned int start;
    char username[32];
    char token[32];
    struct gpio_devices_str devices;
    unsigned int end;
};

extern struct system_par_str system_par;

struct system_runpar_str
{
    unsigned int channel_stas;
    unsigned int flag;
    uint32_t timer;
};
extern struct system_runpar_str system_runpar;
struct PILOT_PARSTR
{
    unsigned char pilot_flag;
    unsigned char blink_num;
    unsigned char on_time;
    unsigned char off_time;
    unsigned char pilot_timer;

    unsigned char pilot_stas;
};
extern struct PILOT_PARSTR pilot_par;

void device_out_set(int index, int stas);
void blink_start(int blink_num, int on_time, int off_time);
void gpio_dev_tick(void *ARG);
void gpio_dev_init(void);
void blink_check(void);
#endif // ! _GPIO_BSP_H_
